package com.example.demo.customer;

import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration

public class CustomerConfiguration

{
    @Value("${app.useFakeCustomerRepo:false}")
    private Boolean userFakeCustomerRepo;

    @Bean
    CommandLineRunner commandLineRunner()
    {
        return args ->
        {
            System.out.println("CLR hello");
        };
    }

    @Bean
    CustomerRepo customerRepo()
    {
        System.out.println("userFakeCustomerRepo : " + userFakeCustomerRepo);
        return new CustomerFakeRepository();
    }
}
